package com.data.modules.online.cgform.converter.p010b;

import java.util.ArrayList;
import com.data.common.system.api.ISysBaseAPI;
import com.data.common.util.SpringContextUtils;
import com.data.common.util.ConvertUtils;
import com.data.modules.online.cgform.converter.p009a.ForeseeConvert;
import com.data.modules.online.cgform.entity.OnlCgformField;
import com.data.modules.online.cgform.util.CgformUtil;

public class UserSelectConverter extends ForeseeConvert {
    public UserSelectConverter(OnlCgformField onlCgformField) {
        this.f123b = ((ISysBaseAPI) SpringContextUtils.getBean(ISysBaseAPI.class)).queryTableDictItemsByCode(CgformUtil.f246T, CgformUtil.f247U, CgformUtil.f248V);
        this.f122a = onlCgformField.getDbFieldName();
    }

    @Override
    public String converterToVal(String txt) {
        if (ConvertUtils.isEmpty(txt)) {
            return null;
        }
        ArrayList arrayList = new ArrayList();
        for (String str : txt.split(CgformUtil.f231E)) {
            String converterToVal = super.converterToVal(str);
            if (converterToVal != null) {
                arrayList.add(converterToVal);
            }
        }
        return String.join(CgformUtil.f231E, arrayList);
    }

    @Override
    public String converterToTxt(String val) {
        if (ConvertUtils.isEmpty(val)) {
            return null;
        }
        ArrayList arrayList = new ArrayList();
        for (String str : val.split(CgformUtil.f231E)) {
            String converterToTxt = super.converterToTxt(str);
            if (converterToTxt != null) {
                arrayList.add(converterToTxt);
            }
        }
        return String.join(CgformUtil.f231E, arrayList);
    }
}
